#include <iostream>

using namespace std;

const int NMax = 10000;
const int Osn = 10000;

class Long
{
private:
	int n;
	int a[NMax];
public:
	Long();
	Long(int);
	~Long();
	friend istream& operator >>(istream&, Long&);
	friend ostream& operator <<(ostream&, Long&);	
	friend bool operator ==(const Long&, const Long&);
	friend bool operator > (const Long&, const Long&);
	friend bool operator < (const Long&, const Long&);
	friend Long operator + (const Long&, const Long&);
	friend Long operator - (const Long&, const Long&);
	friend Long operator * (const Long&, const Long&);
	friend Long operator * (const Long&, const int&);
	friend Long operator * (const int&, const Long&);
	friend Long pow(Long&, int); 
};